package org.space.ai.domain;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 商品业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = Product.class)
public class ProductBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 商品编号
     */
    @NotBlank(message = "商品编号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String productNo;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 商品副标题
     */
    private String subtitle;

    /**
     * 商品描述
     */
    private String description;

    /**
     * 主图
     */
    private String mainImage;

    /**
     * 子图
     */
    private String subImages;

    /**
     * 售价
     */
    @NotNull(message = "售价不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal price;

    /**
     * 原价
     */
    @NotNull(message = "原价不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal originalPrice;

    /**
     * 品牌ID
     */
    @NotNull(message = "品牌不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long brandId;

    /**
     * 分类ID
     */
    @NotNull(message = "分类不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long categoryId;

    /**
     * 状态(0:下架,1:上架)
     */
    @NotNull(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 排序权重
     */
    private Integer sort;

    /**
     * 销量
     */
    private Integer sales;

    /**
     * 是否热销(0:否,1:是)
     */
    private Integer isHot;

    /**
     * 规格值
     */
    private BigDecimal volume;

    /**
     * 单位ID
     */
    private Long unitId;

    /**
     * 搜索关键词
     */
    private String keyword;

    /**
     * 租户ID
     */
    private String tenantId;

    private String isRecommend;
}
